<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>findingboundaries.rst</title>
<style type="text/css">

body {
        margin-top: 5vw;
        margin-left: 10vw;
        margin-right: 10vw;
       	padding: 0;
        font-size: 100%;
        font-family: 'Roboto Condensed', 'Tahoma', 'Arial', sans-serif;
}

#introduction {
   text-align: justify;
}


table.maintable {
   table-layout: fixed;
   border: 0px solid black;
}

table.maintable td {
   padding-right: 2vw;
   padding-left: 0.2vw;
}


   ul.tree, ul.tree ul {
     list-style-type: none;
     background:  repeat-y;
     margin: 0;
     padding: 0;
     margin: 1vw;
   }

   ul.tree ul {
     list-style-type: none;
     margin-left: 5vw;
   }


  ol li {
     list-style-type: decimal;
     margin-left: 0px;
   }

a {
    color: black;
}

   ul.tree li {
     margin: 1vw;
     padding: 0 5vw;
     line-height: 5vw;
     color: #369;
   }

   ul.tree li.last {
     background: no-repeat;
   }

ul.topnav {
    list-style-type: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    background-color: #333;
    font-size: 1.5vw;
    text-align: center;
}

ul.topnav li {float: left;
     list-style-type: none;
}

ul.topnav li a {
    display: block;
    color: white;
    text-align: center;
    padding: 0.2vw 0.0cm;
    width: 8.5vw;
    text-decoration: none;
    font-size: 1.2vw;
}


ul.topnav li a:hover:not(.active) {background-color: #111;color: white}
ul.topnav li a:hover {color: white}

ul.topnav li a.active {background-color: rgb(44, 173, 46);}
ul.topnav li.right {float: right;}

img.logo {max-width: 25vw;}

pre, code { font-size:100%; background:#eeeeee; margin:5vw 0px 5vw; }
tt { font-size: 0.5cm; }
pre { margin:0px 1vw 1vw; white-space: pre-wrap;}
pre.codeinput { padding:5vw; border:0.1vw margin:5vw 0px 5vw; solid #d3d3d3; background:#eeeeee; }
pre.codeoutput { padding:5vw; 5vw; margin:5vw 0px 5vw; color:#4c4c4c; }
pre.error { color:red; }

@media print { pre.codeinput, pre.codeoutput { word-wrap:break-word; width:100%; } }

span.keyword { color:#0000FF }
span.comment { color:#228B22 }
span.string { color:#A020F0 }
span.untermstring { color:#B20000 }
span.syscmd { color:#B28C00 }

.footer {  width: 100%;  padding:5vw 0px; margin:5vw 0px 0px; border-top:1px dotted #878787; font-size:0.8em; line-height:140%; font-style:italic; color:#878787; text-align:left; float:none; }
.footer p { margin:0px; }
.footer a { color:#878787; }
.footer a:hover { color:#878787; text-decoration:underline; }
.footer a:visited { color:#878787; }

   li {
     list-style-type: square;
     background:  repeat-y;
     padding: 0;
   }

   ul {
     list-style-type: square;
     background:  repeat-y;
     padding: 0;
     margin-left: 2vw;
   }



   ul.tree a:hover {
    background: lightgray;
    text-decoration: none;
    display: inline-block;
    width: 100%;
   }


table th { padding:1.2vw 1vw; text-align:left; vertical-align:middle; border: 1px solid #d6d4d4; font-weight:bold; }
table td { padding:1.2vw 1vw; text-align:left; vertical-align:top; border:1px solid #d6d4d4; }
table td.lfig { padding:1.2vw 1vw;  align:center; vertical-align:middle;  border:0px solid #d6d4d4; }
ul {
    list-style-type: circle;
}

ul.tree a {
    color: back;
    text-decoration: none;
    display: block;
    width: 100%;
}

  li {
     list-style-type: square;
   }


</style>
</head>
<body>
<div class="document">


<p>Boundaries can be found from the mesh using the function 'findBoundaries'. It has the following syntax</p>
<pre class="code matlab literal-block">
<span class="name">boundary</span> <span class="punctuation">=</span> <span class="name">findBoundaries</span><span class="punctuation">(</span><span class="name">mesh</span><span class="punctuation">,</span> <span class="name">querystring</span><span class="punctuation">,</span> <span class="name">optional</span> <span class="name">arguments</span><span class="punctuation">);</span>
</pre>
<p>The return value is a vector. The vector holds the indices of boundaries (a line segment).
For example</p>
<pre class="code matlab literal-block">
<span class="name">boundary</span> <span class="punctuation">=</span> <span class="name">findBoundaries</span><span class="punctuation">(</span><span class="name">mesh</span><span class="punctuation">,</span> <span class="literal string">'direction'</span><span class="punctuation">,</span> <span class="punctuation">[</span><span class="name">x1</span> <span class="name">y1</span><span class="punctuation">],</span> <span class="punctuation">[</span><span class="name">x2</span> <span class="name">y2</span><span class="punctuation">],</span> <span class="name">width</span><span class="punctuation">)</span>
</pre>
<p>returns the boundary elements that are within a distance of width/2 from a line going from [x1 y1] to [x2 y2]</p>
<p>A detailed documentation of the optional arguments and the query strings are given below.</p>
<table border="1" class="docutils">
<colgroup>
<col width="5%" />
<col width="53%" />
<col width="4%" />
<col width="20%" />
<col width="11%" />
<col width="6%" />
</colgroup>
<tbody valign="top">
<tr><td><strong>Query string</strong></td>
<td><strong>Description</strong></td>
<td><strong>Arguments</strong></td>
<td><strong>Argument description</strong></td>
<td><strong>Length</strong></td>
<td><strong>Illustration</strong></td>
</tr>
<tr><td rowspan="3">'arc'</td>
<td rowspan="3">Finds a boundary specified by an arc of the unit circle.</td>
<td>origin</td>
<td>Origin point of the arc</td>
<td>2</td>
<td rowspan="3"><img alt="arc.png" class="first last" src="arc.png" />
</td>
</tr>
<tr><td>startangle</td>
<td>Starting angle</td>
<td>1</td>
</tr>
<tr><td>endangle</td>
<td>Ending angle</td>
<td>1</td>
</tr>
<tr><td rowspan="3">'direction'</td>
<td rowspan="3">Finds boundaries that fall within a rectangle. The rectangle is defined by a line that starts from origin and goes to waypoint. The line intersects the rectangle in the middle.</td>
<td>origin</td>
<td>Origin point of the rectangle</td>
<td>2</td>
<td>&nbsp;</td>
</tr>
<tr><td>waypoint</td>
<td>Direction vector of the rectangle</td>
<td>2</td>
<td>&nbsp;</td>
</tr>
<tr><td>width</td>
<td>Width of the rectangle</td>
<td>1</td>
<td>&nbsp;</td>
</tr>
<tr><td>'inverse'</td>
<td>Inverses the selection</td>
<td>elements</td>
<td>Array that contains the indices of the boundary that is selected</td>
<td>number of elements in the selection</td>
<td>&nbsp;</td>
</tr>
<tr><td>'location'</td>
<td>Finds a boundary nearest to a user specified location</td>
<td>location</td>
<td>The location</td>
<td>number of points specified</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
